using System.Collections.Generic;

namespace Limestone
{
    public interface IPageStubCache
    {
        IStorage Storage { get; set; }

        /// <summary>
        /// Caches all parent-child relations
        /// </summary>
        /// <param name="forceDeepReload">Ensures that the cache is rebuilt from scratch</param>
        void LoadPageLookUpCache(bool forceDeepReload);

        void AddPageStub(IPageStub stub, string parentPath);

        /// <summary>
        /// Returns list of pagestubs that are direct descendants of path
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        IEnumerable<IPageStub> GetChildPageStubsFor(string path);

        IEnumerable<IPageStub> GetRootPageStubs(bool excludeHidden);
        bool IsCached(string path);

        /// <summary>
        /// A quicker look up function
        /// </summary>
        /// <param name="path"></param>
        IPageStub GetPageStub(string path);

        void RemovePageStub(string pagePath);

        void MovePageStub(string oldPagePath, string newParentPath);
        ILimeMapNode GetSiteMap(bool includeHidden);
    }

}